package oad.a233.v1.control;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.util.AttributeSet;

public class OADCapForm_ListView extends OADCapForm {

	private OADListView _ListView;
	public OADListView get_ListView() {
		return _ListView;
	}
	private int _lvItemLayout = R.layout.titlelv_lvitem_opal;	
	public int get_lvItemLayout() {
		return _lvItemLayout;
	}
	public void set_lvItemLayout(int _lvItemLayout) {
		this._lvItemLayout = _lvItemLayout;
	}
	
	public OADCapForm_ListView(Context context, AttributeSet attrs) {
		super(context, attrs);
		// TODO Auto-generated constructor stub
		InitView();
	}
	
	
	@Override
	protected void onDraw(Canvas canvas) {
		// TODO Auto-generated method stub
		super.onDraw(canvas);
	}
	
	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		// TODO Auto-generated method stub
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		_ListView.measure(widthMeasureSpec, heightMeasureSpec);
	}
	
	
	private void InitView() {
		// TODO Auto-generated method stub
			
		 _ListView = new OADListView(_Context,_Attrs);
		 _ListView.setCacheColorHint(Color.parseColor("#00000000"));
		 
		 this.addView(_ListView);
		 this.setBackgroundResource(R.drawable.oad_list_cornor_round);
	}
	
	@Override
	void capLayout(boolean c, int l, int t, int r, int b) {
		// TODO Auto-generated method stub
		b+=_ListView.getMeasuredHeight();
		//	t+=_ViewHeight;
		_ListView.layout(l, t, r, b);
	}
	
	
}
